<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">

<section class="content-header">
    <h1>提报计划查询</h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <table id="t1" class="t1">
                        <thead style="display: table-header-group">
                        <tr>
                            <td colspan="14">
                                <img th:src="@{/img/logo3.jpg}" width="64px" height="40px" style="margin-top: -30px">
                                <div style="display: inline-block;margin-top: 5px;margin-left: 20px">
                                    <span style="letter-spacing: 24px;display: block;line-height: 20px">&nbsp;辽宁忠旺机械设备制造有限公司</span>
                                    <span style="display: block;font-size: 12px;line-height: 20px">Liaoning Zhongwang Machinery Equipment Manufacturing Co., Ltd</span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="14" style="font-size: 16px;letter-spacing: 4px;">
                                制作件清单
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="width: 8%;">项目编号</td>
                            <td style="width: 10%;">
                                [[${makeSheet.proCode}]]
                            </td>
                            <td style="width: 8%">项目名称</td>
                            <td colspan="3" style="width: 30%">
                                [[${makeSheet.proName}]]
                            </td>
                            <td style="width: 8%">项目数量</td>
                            <td style="width: 6%">
                                [[${makeSheet.proNum}]]
                            </td>
                            <td style="width: 6%">类型</td>
                            <td style="width: 9%">
                                [[${makeSheet.special}]]
                            </td>
                            <td style="width: 6%">部分</td>
                            <td style="width: 9%">
                                [[${makeSheet.part}]]
                            </td>
                        </tr>

                        </thead>

                    </table>

                </div>
                <div class="box-body">
                    <form id="queryForm" onsubmit="return false;">
                        <input type="hidden" name="sheetId" th:value="${makeSheet.id}">

                    </form>
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    let table, columns,
        sheetId = +$("#sheetId").val();

    /** 选择计划提报类型 */
    function handlerPage() {
        ;
                columns = [
                    {title: '序号', field: 'id', width: '50',
                        formatter: function (value, row, index) {
                            return index + 1;
                        }
                    },
                    {title: "图号", field: 'drawNo'},
                    {title: "图名", field: 'drawName'},
                    {title: "数量", field: 'drawNum',
                        formatter: function (value) {
                            return js.format(value);
                        }
                    },
                    {title: "制作件类型", field: 'makeType'},
                    {title: "备注", field: 'remark', width: '300px'},

                    {title: "附件", field: 'url',
                        formatter: function (value) {
                            if (value) {
                                return '<a target="_blank" href="' + value + '">下载</a>'
                            }
                            return '';
                        }
                    }
                ];

    }

    $(function () {

        handlerPage();

        /** 加载列表 */
        table = js.table.init({
            url: ctx + "production/query/plan/list",
            showExport: false,
            columns: columns
        });

    });
</script>
</body>
</html>
